package engine;

import paulscode.sound.SoundSystem;
import paulscode.sound.SoundSystemConfig;
import paulscode.sound.SoundSystemException;
import paulscode.sound.codecs.CodecWav;
import paulscode.sound.libraries.LibraryJavaSound;
import paulscode.sound.libraries.LibraryLWJGLOpenAL;

public final class MADAL{
			
	private static SoundSystem sndSystem ; 
	
	public static void init(){
		try {
			SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
			SoundSystemConfig.addLibrary(LibraryJavaSound.class);
			SoundSystemConfig.setCodec("wav", CodecWav.class);
		} catch (SoundSystemException e) {
			System.err.println("error linking with the plug-ins");
		}
		sndSystem = new SoundSystem() ;
//		boolean priority = false;
//		String sourcename = "Source 1";
//		String filename = "airbase.wav";
//		boolean loop = false;
//		float x = 0;
//		float y = 0;
//		float z = 0;
//		int aModel = SoundSystemConfig.ATTENUATION_ROLLOFF;
//		float rFactor = SoundSystemConfig.getDefaultRolloff();
	}
	
	public static void exit(){
		sndSystem.cleanup(); 
	}

	public static void quickPlay(){
		sndSystem.quickPlay(false, "Hello.mid", false, 0, 0, 0, 
				SoundSystemConfig.ATTENUATION_ROLLOFF,
				SoundSystemConfig.getDefaultRolloff()); 
	}
	
}
